import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const routes = [
    {
        path: '/',
        name: 'login',
        component: () => import( '../views/login')
    },
    {
        path: '/t',
        name: 't',
        redirect:'/t/center',
        component: () => import('@/views/t/index.vue'),
        children:[
            {
                path: '/t/center',
                name: 'center',
                component: () => import('@/views/t/center.vue')
            },
            {
                path: '/t/class',
                name: 'class',
                component: () => import('@/views/t/class.vue')
            },
            {
                path: '/t/student',
                name: 'student',
                component: () => import('@/views/t/student.vue')
            },
            {
                path: '/t/teacher',
                name: 'teacher',
                component: () => import('@/views/t/teacher.vue')
            },
            {
                path: '/t/create_lesson',
                name: 'create_lesson',
                component: () => import('@/views/t/create_lesson.vue')
            },
            {
                path: '/t/edit_lesson',
                name: 'edit_lesson',
                component: () => import('@/views/t/edit_lesson.vue')
            },
            {
                path: '/t/my_lesson',
                name: 'my_lesson',
                component: () => import('@/views/t/my_lesson.vue')
            },
            {
                path: '/t/teach_exam',
                name: 'teach_exam',
                component: () => import('@/views/t/teach_exam.vue')
            },
            {
                path: '/t/questions_list',
                name: 'questions_list',
                component: () => import('@/views/t/questions_list.vue')
            },
            {
                path: '/t/student_lesson_details',
                name: 'student_lesson_details',
                component: () => import('@/views/t/student_lesson_details.vue')
            },
            
        ]
    },
    {
        path: '/s',
        name: 's',
        redirect:'/s/join_lesson',
        component: () => import('@/views/s/index.vue'),
        children:[
            {
                path: '/s/center',
                name: 'center',
                component: () => import('@/views/s/center.vue')
            },
            {
                path: '/s/join_lesson',
                name: 'join_lesson',
                component: () => import('@/views/s/join_lesson.vue')
            },
            {
                path: '/s/questions_list',
                name: 'questions_list',
                component: () => import('@/views/s/questions_list.vue')
            },
            {
                path: '/s/schoolwork_list',
                name: 'schoolwork_list',
                component: () => import('@/views/s/schoolwork_list.vue')
            },
            {
                path: '/s/schoolwork_show',
                name: 'schoolwork_show',
                component: () => import('@/views/s/schoolwork_show.vue')
            },
        ]
    }
]

const router = new VueRouter({
//   mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
